#include "stdafx.h"
#include "Dialog.h"
#include "Helper.h"

ModalDialog::ModalDialog()
{
	mLayout = new MGUI_Layout(Helper::Instance()->GetLookFeel_White());
	mLayout->SetAlign(MGUI_Align::Stretch);
	mLayout->SetOrder(MGUI_Order::Top);
	mLayout->SetColor(MGUI_Color(0.15f, 0.15f, 0.15f, 0.5f));
	mLayout->SetVisible(false);
}

ModalDialog::~ModalDialog()
{
	delete mLayout;
}

void ModalDialog::DoModal(void * userData)
{
	mUserData = userData;
	mLayout->SetVisible(true);
}

void ModalDialog::EndDialog(bool _ok)
{
	eventEndDialog(_ok);

	mLayout->SetVisible(false);

	mUserData = NULL;
}
